package com.zxmr.webclient.component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zxmr.domain.component.Component;
import com.zxmr.domain.service.ComponentService;

public class ComponentsRepository {

	static Map<String,Component> components = new HashMap<String,Component>();
	
	public static Component getComponent(String name)
	{
		return components.get(name);
	}
	public static void init()
	{
		ComponentService cs = new ComponentService();
		List<Component> component = cs.queryAll();
		if(component == null)return;
		for(Component com : component)
		{
			components.put(com.getName(), com);
		}
	}
}
